//
//  ShopCommentsCell.m
//  OrderSeat
//
//  Created by wangwei on 13-10-8.
//  Copyright (c) 2013年 wangwei. All rights reserved.
//

#import "ShopCommentsCell.h"

@interface ShopCommentsCell ()

@end

@implementation ShopCommentsCell

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {

    }
    return self;
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];
    
    // Configure the view for the selected state
}

- (void)setContent:(NSDictionary*)dic
{
    _nameLabel.text = [dic objectForKey:@"huiyuan"];
    _timeLabel.text = [dic objectForKey:@"add_time"];
    _totalPointLabel.text = [[dic objectForKey:@"pingfen"] stringValue];
    _servicePointLabel.text = [[dic objectForKey:@"fuwu"] stringValue];
    _tastePointLabel.text = [[dic objectForKey:@"kouwei"] stringValue];
    _envPointLabel.text = [[dic objectForKey:@"huanjing"] stringValue];
    _priceLabel.text = [[dic objectForKey:@"xiaofei"] stringValue];
    _commentLabel.text = [dic objectForKey:@"pingyu"];
    
    [self reLayoutSubviews];
}

- (void)reLayoutSubviews
{
    [_nameLabel autoWidthForSingleLine];
    
    [_timeLabel autoWidthForSingleLine];
    _timeLabel.right = self.view.width-3;
    
    [_commentLabel autoHeightForMutiLines];
    
    self.view.height = _commentLabel.bottom_5;
    [self.view drawBorder];
    
    self.height = self.view.bottom_5;
}

@end
